<!DOCTYPE html>
<html>
<head>
    <title>File Upload Example</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
        var socket = new WebSocket("ws://localhost:8080/importTest");

        socket.onmessage = function(event) {
            var progress = parseInt(event.data);
            $("#progress").text(progress + "%");
            console.log(progress)
            if (progress === 100) {
                $("#message").text("File import completed.");
            }
        };

        socket.onclose = function() {
            console.log("WebSocket connection closed.");
        };
    </script>
</head>
<body>
<form method="post" action="/upload" enctype="multipart/form-data">
    <input type="file" name="file" />
    <input type="submit" value="Upload" />
</form>

<div id="progress"></div>
<div id="message"></div>
</body>
</html>
